//
//  QTBuessinessHeaderView.m
//  QTLifeCircle
//
//  Created by 王琼 on 17/1/17.
//  Copyright © 2017年 徐腾. All rights reserved.
//

#import "QTBuessinessHeaderView.h"
#import <UIImageView+WebCache.h>
@interface QTBuessinessHeaderView()

@property(nonatomic, weak) IBOutlet UIImageView * coverImageView;
@property(nonatomic, weak) IBOutlet UILabel *nameLabel;
@property(nonatomic, weak) IBOutlet UIImageView *scoreImageView;
@property(nonatomic, weak) IBOutlet UILabel *scoreLabel;
@property(nonatomic, weak) IBOutlet UILabel *introLabel;
@property(nonatomic, weak) IBOutlet UIButton* address;
@property(nonatomic, weak)IBOutlet UIButton * phoneBtn;

@end

@implementation QTBuessinessHeaderView

-(void)setModel:(QTFmousModel *)model
{
    _model = model;
    NSLog(@"%@------",model);
    //店名
    self.nameLabel.text = model.name;
    //店铺图片地址
    NSURL* URL = [NSURL URLWithString:model.cover];
    [self.coverImageView sd_setImageWithURL:URL placeholderImage:[UIImage imageNamed:@"no"]];
    
    //详情
    self.introLabel.text = model.intro;
    //成绩
    self.scoreLabel.text = model.score;
    //星星 star_5
    self.scoreImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"star_%@",model.score]];

}

-(IBAction)clickButtontn:(UIButton*)sender
{
    //地图100  电话200
    if(sender.tag == 100)
    {
        //想要拿到按钮的文字,将文字传给地图控制器,让控制器定位
        //[self.delegate respondsToSelector:@selector(pushToController:)]返回的是布尔值,可以查看respondsToselector查看返回值
        if([self.delegate respondsToSelector:@selector(pushToController:)] )
        {
            //在这里拿到sender的参数
            [self.delegate pushToController:sender.titleLabel.text];
        }
        
        
    }

}



@end
